package com.chb.docter.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chb.docter.dto.CommentDto;
import com.hos.entity.sys.Comment;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author: 陈海彬
 * @date: Created in 2023/12/25 9:14
 * @description:
 * @modified By:
 * @version:
 */
public interface CommentMapper extends BaseMapper<Comment> {

    @Select("SELECT c.*,p.`name` ,p.avatar FROM `sys_comment` c LEFT JOIN his_patient p ON c.parent_id = p.patient_id where c.value_id = #{valueId}")
    public List<CommentDto> findComment(@Param("valueId") String id);
}
